#pragma once
#include "process.h"

#define SIGN '='

void process(double total, double cur) {
    char* cursor = "|/-\\";
    char buffer[101] = { '\0' };
    double rate = cur / total * 100;

    int i = 0;
    for (; i < (int)rate; i++) {
        buffer[i] = SIGN;
    }

    printf("[%-100s][%.1lf][%c]\r", buffer, rate, cursor[((int)rate) % strlen(cursor)]);
    fflush(stdout);
}